<!--#INCLUDE FILE="config.asp"-->

<%

' Endcrypt information of CC
'Set objEncrypter = Server.CreateObject ("Hyeongryeol.StringEncrypter")
'objEncrypter.Key = edCode
'objEncrypter.InitialVector = conIV

if(Session("SalesAccessLevel") <> 4 ) then
	Response.Redirect("default.asp")
end if

firstname = request("firstname")
lastname = request("lastname")
phonenumber = request("phonenumber")
cell = request("cell")
email = request("email")
emailpassword = request("emailpassword")
username = request("username")
password = request("password")
salesagent = request("salesagent")

'encrypttitle = objEncrypter.Encrypt ( title )

		set objConnect = server.createObject("ADODB.Connection")       
		objConnect.open conStr

		Set oCmd = Server.CreateObject("ADODB.Command")

		oCmd.ActiveConnection = objConnect
		oCmd.CommandText = "dbo.sp_add_new_sales" 
		oCmd.CommandType = 4

		Set firstname = oCmd.CreateParameter("@firstname", 200,1,100, firstname)
		oCmd.Parameters.Append firstname
		
		Set lastname = oCmd.CreateParameter("@lastname", 200,1,100, lastname)
		oCmd.Parameters.Append lastname
		
		Set phonenumber = oCmd.CreateParameter("@phonenumber", 200,1,100, phonenumber)
		oCmd.Parameters.Append phonenumber
		
		Set cell = oCmd.CreateParameter("@cell", 200,1,100, cell)
		oCmd.Parameters.Append cell
		
		Set email = oCmd.CreateParameter("@email", 200,1,100, email)
		oCmd.Parameters.Append email
		
		Set emailpassword = oCmd.CreateParameter("@emailpassword", 200,1,100, emailpassword)
		oCmd.Parameters.Append emailpassword
		
		Set username = oCmd.CreateParameter("@username", 200,1,100, username)
		oCmd.Parameters.Append username
		
		Set password = oCmd.CreateParameter("@password", 200,1,100, password)
		oCmd.Parameters.Append password
		
		Set salesagent = oCmd.CreateParameter("@salesagent", 200,1,100, salesagent)
		oCmd.Parameters.Append salesagent

		set rss = oCmd.execute
		Response.Redirect("sales-view-salespeople.asp")
%>